<%--
   * 软件著作权：东方汇创
   *
   * 系统名称：qb5&activiti
   *
   * 文件名称：taskInfo.jsp
   *
   * 功能描述：默认节点详细页面
   * 
   * 版本历史：
   * 2016-12-26   1.0.0版 （龙色波）（创建文件）
   * 
--%>
<%@page import="com.dfhc.util.CryptoHelper"%>
<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@page import="java.util.Map"%>
<%@page import="com.dfhc.ISystemConstant"%>
<%@page import="org.quickbundle.tools.helper.RmVoHelper" %>
<%@page import="org.quickbundle.tools.helper.RmStringHelper" %>
<%@page import="com.dfhc.wk.generalbusinessprocess.vo.GeneralBusinessProcessVo" %>
<%@page import="com.dfhc.wk.generalbusinessprocess.IGeneralBusinessProcessConstants" %>
<%  //判断是否只读
    boolean isReadOnly = false;
    if("1".equals(request.getAttribute(IGeneralBusinessProcessConstants.REQUEST_IS_READ_ONLY))) {
        isReadOnly = true;
    } else if("1".equals(request.getParameter(IGeneralBusinessProcessConstants.REQUEST_IS_READ_ONLY))){
        isReadOnly = true;
    } 
%>
<%  //取出本条记录
    Map map1 = null;
    Map resultVo = null;  //定义一个临时的vo变量
    map1 = (Map)request.getAttribute(IGeneralBusinessProcessConstants.REQUEST_BEAN);  //从request中取出vo, 赋值给resultVo
    if(map1!=null){
    	resultVo = (Map)map1.get(ISystemConstant.PREDEFINED_PROCESS_GENERAL_BUSINESS_PROCESSVO);//取出通用业务值对象
    	RmVoHelper.replaceToHtml(resultVo);  //把vo中的每个值过滤
    }
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<%@ include file="/jsp/include/web/jqGrid/global.jsp" %>
<link href="<%=request.getContextPath() %>/css/index.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><bean:message key="qb.web_title"/></title>
<script type="text/javascript">
<%if(!isReadOnly) {%>
    function find_onClick(){  //直接点到修改页面
    	var taskId=<%=request.getParameter(ISystemConstant.PREDEFINED_TASK_ID) %>;
    	form.action="<%=request.getContextPath()%><%=CryptoHelper.encryptUrl(request,"/generalbusinessprocess/complete")%>?id=" +taskId;
    	form.submit();
    }
 
    function delete_onClick(){  //直接点删除单条记录
        if(!getConfirm()) {  //如果用户在确认对话框中点"取消"
            return false;
        }
        form.action="<%=request.getContextPath()%><%=CryptoHelper.encryptUrl(request,"/generalbusinessprocess/delete")%>";
        form.submit();
    } <%} %>
</script>
</head>
<body style="background:#fff;">
<form name="form" method="post">
<c:forEach items="${bean.GeneralBusinessProcessVo}" var="bean1" varStatus="rowCounter"	begin='0' step='1'> 
<input type ="hidden" id="procDefId" name="procDefId" value="${ bean1.procDefId}" ></input> 
</c:forEach>
<h3>节点信息：</h3>
<table class="mainTable" style="position:relative;top:10px;">
	<c:forEach items="${bean.formDataList}" var="bean1" varStatus="rowCounter"	begin='0' step='1'>  
	<tr>
		<td align="right">${bean1.name}：</td>
		<td>
		<!--  input标签 -->
		<c:if test="${bean1.type.name=='string'}">
		   <input type="text" name="${bean1.id}" id="${bean1.id}" value="${bean1.value}"
		    <c:if test="${bean1.writable!='true'}">
		      readonly
		    </c:if>
		   >
		</c:if>
		<!--  枚举 -->
		<c:if test="${bean1.type.name=='enum'}">
			<select name='${bean1.id}'>
			  <c:forEach items="${bean.enumTypeMap}" var="m">
			    <!--  查找对应的枚举值列表-->
			  	<c:if test="${m.key==bean1.id}">
			  	   <c:forEach items="${m.value}" var ="enumItem">
			  	   <option value="${enumItem.key}">
				     ${enumItem.value}
				    </option>
			  	   </c:forEach>
			  	</c:if>
			  </c:forEach>
			</select>
		</c:if>
		<!--  文件 -->
		<c:if test="${bean1.type.name=='file'}">
			<input type="file" name="${bean1.id}" id="${bean1.id}"/>
		</c:if>
		<!--  多行文本 -->
		<c:if test="${bean1.type.name=='textarea'}">
			<textarea name="${bean1.id}" <c:if test="${bean1.writable!='true'}">
		      readonly
		    </c:if>></textarea>
		</c:if>
		<!--  日期 -->
		<c:if test="${bean1.type.name=='date'}">
			<input type="text" name="${bean1.id}" id="${bean1.id}"  value="${bean1.value}" onclick="showDate();" <c:if test="${bean1.writable!='true'}">
		      readonly
		    </c:if>/>
		</c:if>
		<!--  日期时间-->
		<c:if test="${bean1.type.name=='datetime'}">
			<input type="text" name="${bean1.id}" id="${bean1.id}"  value="${bean1.value}" onclick="showDateTime();" <c:if test="${bean1.writable!='true'}">
		      readonly
		    </c:if>/>
		</c:if>
		</td>
	</tr>
	</c:forEach> 
	</table>
<h3>审核意见列表:</h3>
<table class="mainTable" border="1" >
	<tr>
	  <td>姓名</td>
	  <td>处理结果</td>
	  <td>处理意见</td>
	  <td>处理时间</td>	
	</tr>
	<c:forEach items="${bean.auditVos}" var="bean1" varStatus="rowCounter" begin='0' step='1'>	    
	<tr>
		<td align="center">${bean1.auditName}</td>
		<td	align="center">${bean1.auditState}</td>
		<td	align="center">${bean1.auditOpinion}</td>
		<td	align="center">${bean1.auditTime}</td>
	</tr>
	</c:forEach>
</table>
<p>
<div class="button_area">
    <input type="button" class="onClickToBtn" id="button_update" value="提交" onclick="javascript:find_onClick();" />
</div>   
</form>
</body>
</html>	
